'use strict'

const setting = require('./src/config/index')
const port = process.env.port || process.env.npm_config_port || 9091

module.exports = {
    publicPath: '/',
    outputDir: 'dist',
    assetsDir: 'static',
    lintOnSave: false,
    productionSourceMap: false,
    css: {
        loaderOptions: {
            sass: {
                additionalData: `@import "@/styles/variables.scss";`
            }
        }
    },
    chainWebpack: config => {
        config.plugin('html').tap(args => {
            args[0].title = setting.title
            return args
        })
    },
    devServer: {
        port: port,
        hot: true,
        open: false,
        overlay: {
            warnings: false,
            errors: true
        },
        disableHostCheck: true
    }
}
